CC=gcc
CXX=g++
LIBS =  -lmad -lpthread -lvorbis -lvorbisfile -logg -lopenal
CXXFLAGS= -Wall -lm -O3 -march=native -mfpmath=sse
CFLAGS=-std=c99 -lm -O3 -march=native -mfpmath=sse
s="done"
all: main.out
	@echo $(s)

Data.o:
	$(CXX) $(CXXFLAGS) -c dataplugins/Data.cpp -o Data.o

SoundData.o:
	$(CXX) $(CXXFLAGS) -c dataplugins/SoundData.cpp -o SoundData.o

OpenAlContext.o:
	$(CXX) $(CXXFLAGS) -c output/OpenAlContext.cpp -o OpenAlContext.o

Sound.o:
	$(CXX) $(CXXFLAGS) -c output/Sound.cpp -o Sound.o

Vector3D.o:
	$(CXX) $(CXXFLAGS) -c utils/Vector3D.cpp -o Vector3D.o

engine_error.o:
	$(CXX) $(CXXFLAGS) -c utils/engine_error.cpp -o engine_error.o

main.out: Data.o SoundData.o OpenAlContext.o Sound.o Vector3D.o alengine.o engine_error.o main.o
	$(CXX) $(CXXFLAGS) Sound.o OpenAlContext.o SoundData.o Data.o engine_error.o Vector3D.o alengine.o main.o $(LIBS) -L /usr/lib64/libopenal.so.1 -o main.out
clean:
	rm -rf *.o *.out
